<script setup lang="ts">
	import { defineComponent } from 'vue'
  import { useMouse } from '@vueuse/core'
  import { debounce } from '@/utils/util'

  const { x, y } = useMouse()

  function mouseMove(e) {
    console.log(e);
  }
  const mouseMoveWrap = debounce(mouseMove, 1000, true);
  function cancelDebounce() {
    mouseMoveWrap.cancel()
  }
</script>

<template>
  <button @click="cancelDebounce">取消debounce</button>
	<h2 @mousemove="mouseMoveWrap">测试 vueUse 的鼠标坐标</h2>
  <h3>Mouse: {{x}} x {{y}}</h3>
</template>